import request from '@/utils/request'
import { UserRecord } from "@/types/user";
/**
 * 获取账号信息
 * @param params 
 * @returns 
 */
export const getInfo = (params: any) => {
  return request({
    url: '/user/account',
    method: 'get',
    params
  })
}

/**
 * 获取用户详情
 * @param params 
 * @returns 
 */
export const detail = (params: any) => {
  return request({
    url: '/user/detail',
    method: 'get',
    params
  })
}
// 获取用户播放记录
// 说明 : 登录后调用此接口 , 传入用户 id, 可获取用户播放记录
// 必选参数 : uid : 用户 id

// 可选参数 : type : type=1 时只返回 weekData, type=0 时返回 allData
export const getUserRecord = (params: UserRecord) => {
  return request({
    url: '/user/record',
    method: 'get',
    params
  })
}

// 用户动态
export const event = (params?: any) => {
  return request({
    url: '/user/event',
    method: 'get',
    params,
  })
}

// 获取用户关注列表
export const follows = (params?: any) => {
  return request({
    url: '/user/follows',
    method: 'get',
    params,
  })
}

// 获取用户粉丝列表
export const followeds = (params?: any) => {
  return request({
    url: '/user/followeds',
    method: 'get',
    params,
  })
}